﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XFramework;

public class ChatSystem : IGameModule
{
    private List<Message> m_Messages;

    public ChatSystem()
    {
        m_Messages = new List<Message>()
        {
            new Message(1,"你是我儿子"),
            new Message(1,"你是我儿子"),
            new Message(0,"我是你大爷"),
        };
    }

    public IEnumerable<Message> GetMessages()
    {
        return m_Messages;
    }

    public void AddMessage(int sender, string content)
    {
        m_Messages.Add(new Message(sender, content));
    }

    #region 接口实现

    public int Priority => 10000;

    public void Shutdown()
    {
    }

    public void Update(float elapseSeconds, float realElapseSeconds)
    {
    }

    #endregion


    // 消息
    public class Message
    {
        public int sender;
        public string content;

        public Message(int direction, string content)
        {
            this.sender = direction;
            this.content = content;
        }
    }
}
